﻿using System;
using System.Collections.Generic;

using System.Text;
using ITAP.ShprossesBuilder.Modelling.Components;
using Atechnology.glassCAD.Shapes;

namespace ITAP.ShprossesBuilder.Editor
{
    public class ModelProvider
    {
        public static ModelContainer CreateEmptyModel()
        {
            ModelContainer container = new ModelContainer();
            container.Update();
            return container;
        }

        public static ModelContainer CreateModel()
        {
            Shape shape = Shape.Get(new Param(), ProgramType.Glass, 26);
            Model model = ComponentFactory.CreateModel(0);
            Spacer spacer = ComponentFactory.CreateSpacer(shape.GetDxfContours()[0], 10, "");
            model.AddInnerComponent(spacer);

            ModelContainer container = new ModelContainer();
            ModelCell cell = new ModelCell();
            cell.AddInnerComponent(model);
            container.AddInnerComponent(cell);
            //cell = new ModelCell();
            //cell.AddInnerComponent((Model)model.Clone());
            //container.AddInnerComponent(cell);
            container.Update();
            return container;
        }
    }
}
